package com.example.bootkafka1;

import com.example.bootkafka1.common.KafkaProducer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Bootkafka1Application {

	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(Bootkafka1Application.class, args);

        KafkaProducer kafkaProducer = run.getBean(KafkaProducer.class);
        kafkaProducer.send("dyg","测试发送消息");
//        for (int i = 0;i < 10;i++){
//            kafkaProducer.send("dyg","测试发送消息"+i);
//        }

    }
}
